<!--
Copyright 2017 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<div fxFlex
     fxLayout="column">
  <h2 mat-dialog-title
      i18n>Add Namespace</h2>
  <mat-dialog-content fxLayout="column"
                      class="kd-dialog-text">
    <div i18n>Provide a namespace name that should be added to the namespace fallback list</div>

    <mat-form-field fxFlex>
      <input #namespaceInput
             name="defaultNamespace"
             i18n-placeholder
             placeholder="Namespace"
             type="text"
             [matAutocomplete]="auto"
             matInput>
      <mat-autocomplete #auto="matAutocomplete">
        <mat-option *ngFor="let namespace of data.namespaces | kdFilterBy: namespaceInput.value"
                    [value]="namespace">
          {{namespace}}
        </mat-option>
      </mat-autocomplete>
    </mat-form-field>
  </mat-dialog-content>

  <mat-dialog-actions>
    <button mat-raised-button
            color="primary"
            [disabled]="namespaceInput?.value?.length === 0"
            [mat-dialog-close]="namespaceInput.value"
            i18n>Add
    </button>
    <button mat-button
            color="primary"
            [mat-dialog-close]=""
            i18n>Close
    </button>
  </mat-dialog-actions>
</div>
